package datapool.player
{
	import datapool.char.Char;
	/**
	 * @author Administrator
	 */
	public class Player
	{
		private var _chars:Array;
		private var _package:Array;  //背包
		
		public var money:uint;
		
		public function Player()
		{
			init();
		}
		
		private function init():void
		{
			_chars   = [];
			_package = [];
			
			var char:Char = new Char();
			_chars.push(char);
		}
		
		public function get chars():Array
		{
			return _chars;
		}
		
		public function getCharByElementType(elmentType:int):Char
		{
			var i:int;
			var char:Char;
			for(i=0; i<chars.length; i++)
			{
				char = chars[i] as Char;
				if(char)
				{
					if(char.elmentType == elmentType)
					{
						return char;
					}
				}
			}
			return null;
		}
		
		public function get mainChar():Char
		{
			return chars[0] as Char;
		}
		
		public function getPackage():Array
		{
			return _package;
		}
	}
}
